Universal Serial Bus (“USB”) is a well-known industry communication protocol for electronic devices. USB provides a well-defined standard protocol that allows electronic devices to communicate with each other and to provide power delivery to them as well. Various versions of the USB protocol exist, such as USB 1.x, USB 2.0, USB 3.0, USB 3.1, USB-C.
An existing method for isochronous data synchronization for Universal Serial Bus (“USB”), USB Audio Class (“UAC”) 1.0 and UAC 2.0 audio is called asynchronous. From the UAC 2.0 specification, “asynchronous isochronous audio endpoints produce or consume data at a rate that is locked either to a clock external to the USB or to a free-running internal clock. These endpoints cannot be synchronized to a start of frame (SOF) or to any other clock in the USB domain.” Because the device clock and USB clock are not synchronized, there is a high probability that the device will produce or consume data at a different rate than the host. This asynchronous condition will inevitably result in the device having too much or not enough data to consume or produce resulting in audio distortion because of loss of data.
Current USB 2.0, UAC 1.0 and UAC 2.0 specifications instruct developers implementing an isochronous endpoint using asynchronous synchronization type to “provide explicit feedback to the host by indicating accurately what its desired data rate (Ff) is, relative to the USB (micro)frame frequency” in order to maintain data synchronization between the host and device. The feedback information sent is either a 10.10 (for full speed) or 16.16 (for high speed) value that represents the desired data rate at which audio samples should be sent to the device to prevent loss of audio synchronization, resulting in poor audio quality. This data provides the host with information on how the rate at which it sends the samples to the device changes.
The USB 2.0 specification suggests calculating the explicit feedback using the local device clock to determine the actual sampling rate referenced to the USB start of frame (SOF), or the USB frame or microframe frequency. This actual sampling rate is then used by the device to calculate the rate required from the host to maintain synchronization. However, this approach has many disadvantages, including:
1. The feedback information sent is a quantized ratio of analog clock frequencies, and the reported value will most likely be close but not the exact ratio. Accumulation of such quantization errors over time makes it possible for the audio samples to underflow or overflow an audio buffer.
2. There could be a delay in calculating the clock ratios, and as a result, the device may be subject to loss of buffer centering. Increased loss of buffer centering increases the possibility of buffer underflow or overflow. Over time, due to lack of loss of buffer centering, the device buffers could be within one sample of underflow or overflow before the host adjusts the samples being sent. Even if the host is sending samples at a perfect rate, the buffer may still remain one sample away from underflow or overflow. The clocks used may be subject to temperature and/or voltage drift, and before the feedback can be updated, the device buffer may underflow or overflow due to environmental changes.
3. Measuring the SOF clock with respect to the system clock may be difficult and have variance due to such things as system interrupts.
4. The USB specification does not detail a time for the host to respond to the synchronization feedback given by the device, resulting in varying response times among different USB host hardware and software implementations.